package com.zju.cst.cloudApp;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SystemConfig {

	private	static ApplicationContext context;
	private static String XML_NAME = "applicationContext.xml";
	
	static {
		try {
			context = new ClassPathXmlApplicationContext(XML_NAME);
		} catch (Exception e) {
			e.printStackTrace();
			//logger
		}
	}

	public static Object getBean(String beanName) {
		return context.getBean(beanName) == null ? null : context.getBean(beanName);
	}
	
	public static void main(String[] args) {
		SystemConfig.getBean("aa");
	}
}

